<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>
<style>
    .hd1{color: red}
    .hd2{color: aqua}

</style>
    <div id="app">
        <h1 :class="'hd'+n">后端君</h1>
        <input type="text" v-model="n"><br/>
        <input type="radio" v-model="n" value="1">红
        <input type="radio" v-model="n" value="2">蓝
    </div>

<script>
    var app=new Vue({
        el:'#app',
        data:{
            n:1
        }
    });

</script>
</body>
</html>